package com.linys.scala.qf.day03

/**
  * Created by admin on 2019/10/22.
  */
class Person {
  var id : Int = _
  var name : String = _
  var b : Boolean = _
  val address = "dsafsdfs"
  private var age : Int = _

  private [this] val gender = "male"
  def getGender : String = {
    return gender
  }

}

// 伴生对象
object Person{
  def main(args: Array[String]): Unit = {
    val p = new Person
    println(p.id)
    println(p.name)
    println(p.b)
    println(p.address)
    p.age = 19
    println(p.age)
    println(p.getGender)
  }
}

object Test{
  def main(args: Array[String]): Unit = {
    val p = new Person
    println(p.id)
    println(p.name)
    println(p.b)
    println(p.address)
    println(p.getGender)
  }
}
